#include <iostream>
#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>

int main()
{
    pid_t id = fork();
    if(id == 0)
    {
        int a = 10;
        a /= 0;
    }
    int status = 0;
    waitpid(id, &status, 0);
    printf("Signal: %d, ExitCode: %d, CoreDump: %d\n", status&0x7F, (status >> 8)&0xFF, (status >> 7) & 1);
    return 0;
}

// int main()
// {
//     int a = 10;
//     a /= 0;
//     return 0;
// }